<!DOCTYPE html>



  


<html class="theme-next gemini use-motion" lang="en">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="theme-color" content="#222">

<script type="text/javascript" src="http://tajs.qq.com/stats?sId=64887707" charset="UTF-8"></script>



  
  
    
    
  <script src="/lib/pace/pace.min.js?v=1.0.2"></script>
  <link href="/lib/pace/pace-theme-flash.min.css?v=1.0.2" rel="stylesheet">




  
  
  <link rel="stylesheet" media="all" href="/lib/Han/dist/han.min.css?v=3.3">




<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />


















  
  
    
  
  <link href="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.2/dist/jquery.fancybox.min.css" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.lug.ustc.edu.cn/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.2" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="Hexo,Git,GitHub,Node.js," />








  <link rel="shortcut icon" type="image/x-icon" href="/images/favicon.ico?v=5.1.2" />






<meta name="description" content="本篇是自己在搭建Hexo博客平台时的一个过程记录。">
<meta name="keywords" content="Hexo,Git,GitHub,Node.js">
<meta property="og:type" content="article">
<meta property="og:title" content="利用GitHub+Node.js+Hexo搭建个人博客">
<meta property="og:url" content="https://asdfv1929.github.io/2017/11/18/hexo-next-blog/index.html">
<meta property="og:site_name" content="asdfv1929 &#39;s Home">
<meta property="og:description" content="本篇是自己在搭建Hexo博客平台时的一个过程记录。">
<meta property="og:locale" content="en">
<meta property="og:image" content="http://ww3.sinaimg.cn/large/0060lm7Tly1fjqfr7saqaj31150heack.jpg">
<meta property="og:image" content="http://ww2.sinaimg.cn/large/0060lm7Tly1fjqfva3evoj30m60ha401.jpg">
<meta property="og:image" content="http://ww2.sinaimg.cn/large/0060lm7Tly1fjqfw6c3bjj30ha0hidgw.jpg">
<meta property="og:image" content="http://ww2.sinaimg.cn/large/0060lm7Tly1fjqfxa14ysj30nv0artb4.jpg">
<meta property="og:image" content="http://ww2.sinaimg.cn/large/0060lm7Tly1fjqfy30a87j30fx0eddgo.jpg">
<meta property="og:image" content="http://ww4.sinaimg.cn/large/0060lm7Tly1fjqfykie1rj30n20g10u5.jpg">
<meta property="og:image" content="http://ww1.sinaimg.cn/large/0060lm7Tly1fjqfz3epm3j30mr0fpwfn.jpg">
<meta property="og:image" content="http://ww1.sinaimg.cn/large/0060lm7Tly1fjqg0ny0uxj30gs08udg7.jpg">
<meta property="og:image" content="http://ww1.sinaimg.cn/large/0060lm7Tly1fjqg18kp0bj30ng0hgjud.jpg">
<meta property="og:image" content="http://ww3.sinaimg.cn/large/0060lm7Tly1fmz4jzxilkj30mz0h00yr.jpg">
<meta property="og:image" content="http://ww1.sinaimg.cn/large/0060lm7Tly1fjqg27vt49j30gp0h6my5.jpg">
<meta property="og:image" content="http://ww2.sinaimg.cn/large/0060lm7Tly1fjqg2nopg1j31160h1whc.jpg">
<meta property="og:image" content="http://ww4.sinaimg.cn/large/0060lm7Tly1fjqg371q2rj30gy05uwer.jpg">
<meta property="og:image" content="http://ww1.sinaimg.cn/large/0060lm7Tly1fjqg3nk2t5j307s02ea9u.jpg">
<meta property="og:image" content="http://ww2.sinaimg.cn/large/0060lm7Tly1fmz5d5akdsj30qo0apgm6.jpg">
<meta property="og:image" content="http://ww1.sinaimg.cn/large/0060lm7Tly1fmz5fpy4brj304x072jrb.jpg">
<meta property="og:image" content="http://ww4.sinaimg.cn/large/0060lm7Tly1fmz5t2fwj1j30g201hwea.jpg">
<meta property="og:image" content="http://ww1.sinaimg.cn/large/0060lm7Tly1fmz5uq2ycej31g60ptdrw.jpg">
<meta property="og:image" content="http://ww4.sinaimg.cn/large/0060lm7Tly1fmz65yo3c1j30dj012742.jpg">
<meta property="og:image" content="http://ww2.sinaimg.cn/large/0060lm7Tly1fjqg41skzuj30iw07sgmy.jpg">
<meta property="og:image" content="http://ww1.sinaimg.cn/large/0060lm7Tly1fjqg4fzrisj307b01cmwx.jpg">
<meta property="og:image" content="http://ww2.sinaimg.cn/large/0060lm7Tly1fmz8kkuoovj30sj0hb3zx.jpg">
<meta property="og:updated_time" content="2018-01-19T15:10:17.340Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="利用GitHub+Node.js+Hexo搭建个人博客">
<meta name="twitter:description" content="本篇是自己在搭建Hexo博客平台时的一个过程记录。">
<meta name="twitter:image" content="http://ww3.sinaimg.cn/large/0060lm7Tly1fjqfr7saqaj31150heack.jpg">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Gemini',
    version: '5.1.2',
    sidebar: {"position":"left","display":"hide","offset":12,"offset_float":12,"b2t":false,"scrollpercent":true,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn"}},
    duoshuo: {
      userId: '0',
      author: 'Author'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://asdfv1929.github.io/2017/11/18/hexo-next-blog/"/>





  <title>利用GitHub+Node.js+Hexo搭建个人博客 | asdfv1929 's Home</title>

  









</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="en">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">asdfv1929 's Home</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <h1 class="site-subtitle" itemprop="description"></h1>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            Home
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            Tags
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            Categories
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            Archives
          </a>
        </li>
      
        
        <li class="menu-item menu-item-photos">
          <a href="/photos/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-image"></i> <br />
            
            Photos
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            About
          </a>
        </li>
      
        
        <li class="menu-item menu-item-links">
          <a href="/links/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-address-book"></i> <br />
            
            Links
          </a>
        </li>
      

      
        <li class="menu-item menu-item-search">
          
            <a href="javascript:;" class="popup-trigger">
          
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br />
            
            Search
          </a>
        </li>
      
    </ul>
  

  
    <div class="site-search">
      
  <div class="popup search-popup local-search-popup">
  <div class="local-search-header clearfix">
    <span class="search-icon">
      <i class="fa fa-search"></i>
    </span>
    <span class="popup-btn-close">
      <i class="fa fa-times-circle"></i>
    </span>
    <div class="local-search-input-wrapper">
      <input autocomplete="off"
             placeholder="Searching..." spellcheck="false"
             type="text" id="local-search-input">
    </div>
  </div>
  <div id="local-search-result"></div>
</div>



    </div>
  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://asdfv1929.github.io/2017/11/18/hexo-next-blog/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="asdfv1929">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/headpic.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="asdfv1929 's Home">
    </span>

    
      <header class="post-header">

        
        
          <h2 class="post-title" itemprop="name headline">利用GitHub+Node.js+Hexo搭建个人博客</h2>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">Posted on</span>
              
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2017-11-18T22:39:36+08:00">
                2017-11-18
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">In</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/GitBlog/" itemprop="url" rel="index">
                    <span itemprop="name">GitBlog</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          
             <span id="/2017/11/18/hexo-next-blog/" class="leancloud_visitors" data-flag-title="利用GitHub+Node.js+Hexo搭建个人博客">
               <span class="post-meta-divider">|</span>
               <span class="post-meta-item-icon">
                 <i class="fa fa-eye"></i>
               </span>
               
                 <span class="post-meta-item-text">Visitors&#58;</span>
               
                 <span class="leancloud-visitors-count"></span>
             </span>
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body han-init-context" itemprop="articleBody">

      
      

      
        <p>本篇是自己在搭建Hexo博客平台时的一个过程记录。<br><a id="more"></a></p>
<h2 id="GitHub"><a href="#GitHub" class="headerlink" title="GitHub"></a>GitHub</h2><h3 id="账号注册"><a href="#账号注册" class="headerlink" title="账号注册"></a>账号注册</h3><p>因为此文所搭建的个人博客是基于GitHub平台服务的，所以首先是注册GitHub，当然已有账号的跳过此步；  </p>
<p>传送门：<a href="https://github.com/" target="_blank" rel="external">GitHub官网</a>，页面如下，输入username、email、password后点击Sign Up注册，当然这些之后是需要去对应的邮箱邮件里进行注册激活。<br><img src="http://ww3.sinaimg.cn/large/0060lm7Tly1fjqfr7saqaj31150heack.jpg" alt="github_index"><br>页面跳转至如下，这边我们是点击Continue，默认里面其他设置。<br><img src="http://ww2.sinaimg.cn/large/0060lm7Tly1fjqfva3evoj30m60ha401.jpg" alt="github_continue"><br>页面如下，根据问题勾选自己对应的。<br><img src="http://ww2.sinaimg.cn/large/0060lm7Tly1fjqfw6c3bjj30ha0hidgw.jpg" alt="github_step"></p>
<h3 id="创建Repository"><a href="#创建Repository" class="headerlink" title="创建Repository"></a>创建Repository</h3><p>基本配置完成后，跳转至如下，这边我们就直接<code>Start a project</code>了，你也可以选择先看下<code>guide</code>，<br><img src="http://ww2.sinaimg.cn/large/0060lm7Tly1fjqfxa14ysj30nv0artb4.jpg" alt="github_start"><br>点击开始后，跳转至<code>Create a new repository</code>，这边Repository name命名规则就是<code>username.github.io</code>，其中username就是你注册时的username。<br><img src="http://ww2.sinaimg.cn/large/0060lm7Tly1fjqfy30a87j30fx0eddgo.jpg" alt="github_create"></p>
<h3 id="Settings"><a href="#Settings" class="headerlink" title="Settings"></a>Settings</h3><p>点击创建之后页面跳转至project内，这时我们点击<code>settings</code><br><img src="http://ww4.sinaimg.cn/large/0060lm7Tly1fjqfykie1rj30n20g10u5.jpg" alt="github_setting"><br>这边就是<code>setting</code>下<br><img src="http://ww1.sinaimg.cn/large/0060lm7Tly1fjqfz3epm3j30mr0fpwfn.jpg" alt="github_setindex"><br>这时我们在该页面往下拖动网页，找到<code>GitHub Pages</code>，之后点击<code>Choose a theme</code>选择页面主题，这边我们就暂时选择默认的主题（因为后面我会更换为NexT主题的），然后点击<code>Select theme</code>。<br><img src="http://ww1.sinaimg.cn/large/0060lm7Tly1fjqg0ny0uxj30gs08udg7.jpg" alt="github_pages"><br><img src="http://ww1.sinaimg.cn/large/0060lm7Tly1fjqg18kp0bj30ng0hgjud.jpg" alt="github_theme">  </p>
<h3 id="GitHub-Page"><a href="#GitHub-Page" class="headerlink" title="GitHub Page"></a>GitHub Page</h3><p>点击选择主题后，页面会跳转至该Repository的可以说是主页吧，如下所示。上面有提醒主题更换，也有生成一个<code>index.md</code>markdown文件。这时我们再去刚才的<code>setting</code>设置里去看刚刚的<code>GitHub Pages</code>那边，会有显示你的url，这就是你未来博客“搭建”在该网址上。<br><img src="http://ww3.sinaimg.cn/large/0060lm7Tly1fmz4jzxilkj30mz0h00yr.jpg" alt="github_indexmd"><br><img src="http://ww1.sinaimg.cn/large/0060lm7Tly1fjqg27vt49j30gp0h6my5.jpg" alt="github_url"><br>此时点击该url访问到的也就是你未来个人博客将会展示的样子<br><img src="http://ww2.sinaimg.cn/large/0060lm7Tly1fjqg2nopg1j31160h1whc.jpg" alt="github_urlpage"></p>
<h2 id="Node-Js"><a href="#Node-Js" class="headerlink" title="Node.Js"></a>Node.Js</h2><h3 id="下载安装"><a href="#下载安装" class="headerlink" title="下载安装"></a>下载安装</h3><p>传送门：<a href="https://nodejs.org/en/" target="_blank" rel="external">NodeJs</a>，选择对应的版本进行下载，安装的话就点点点，这边就不在叙述了。<br><img src="http://ww4.sinaimg.cn/large/0060lm7Tly1fjqg371q2rj30gy05uwer.jpg" alt="nodejs_exe"><br>软件安装完成后，打开cmd界面，输入<code>node -v</code>和<code>npm -v</code>（注意查看环境变量部分是否已经正确），查验其版本，确认是否安装成功。<br><img src="http://ww1.sinaimg.cn/large/0060lm7Tly1fjqg3nk2t5j307s02ea9u.jpg" alt="node_version"></p>
<h3 id="安装Hexo"><a href="#安装Hexo" class="headerlink" title="安装Hexo"></a>安装Hexo</h3><p>在命令行输入：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">npm install -g hexo-cli</div></pre></td></tr></table></figure></p>
<p>之后创建一个文件夹（搭建博客的相关文件存放于此），此处我命名为test（可自主命名），在该文件夹路径下打开cmd（在文件夹下的路径输入框中输入cmd并回车），或者直接在cmd中切换到该文件夹下，输入：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">hexo init</div></pre></td></tr></table></figure></p>
<p>运行后的样子，其中在下载默认主题landscape时，出现了一些乱码，不过这些问题不大，最后显示添加add成功就行：<br><img src="http://ww2.sinaimg.cn/large/0060lm7Tly1fmz5d5akdsj30qo0apgm6.jpg" alt="cmd"><br>此时文件夹下多了如下一些内容：<br><img src="http://ww1.sinaimg.cn/large/0060lm7Tly1fmz5fpy4brj304x072jrb.jpg" alt="blog folder"></p>
<h3 id="本地运行"><a href="#本地运行" class="headerlink" title="本地运行"></a>本地运行</h3><p>此时还是在该文件夹路径下的cmd里输入（-p 5000 表示设置端口号为5000；若不写这个，则默认为4000，但可能会出现端口号被占用的情况，导致网页无法打开）：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">hexo server -p 5000</div></pre></td></tr></table></figure></p>
<p><img src="http://ww4.sinaimg.cn/large/0060lm7Tly1fmz5t2fwj1j30g201hwea.jpg" alt="server"></p>
<p>此时浏览器上输入<code>http://localhost:5000/</code>，访问到博客的默认界面：<br><img src="http://ww1.sinaimg.cn/large/0060lm7Tly1fmz5uq2ycej31g60ptdrw.jpg" alt="hexo ui"></p>
<h3 id="hexo相关命令"><a href="#hexo相关命令" class="headerlink" title="hexo相关命令"></a>hexo相关命令</h3><p>新建某一博客，文件名为<code>this_is_a_test_blog.md</code>，此为markdown文件，文件路径为<code>source\_posts\</code><br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">hexo new this_is_a_test_blog</div></pre></td></tr></table></figure></p>
<p><img src="http://ww4.sinaimg.cn/large/0060lm7Tly1fmz65yo3c1j30dj012742.jpg" alt="test blog">    </p>
<p>我们可以在这<code>this_is_a_test_blog.md</code>文件里添加自己的博客内容，因为我是用作测试的，所以什么内容这边就不贴图了。重新运行<code>hexo server -p 5000</code>，访问localhost可以看到，网页中有了内容添加。</p>
<p>其他相关的命令如下：<br><code>hexo clean</code>  删除public文件夹及其内容（public文件夹的内容即为上传至GitHub Repositoriy的内容）<br><code>hexo generate</code>或<code>hexo g</code> 生成上传至GitHub的内容，即public文件夹<br><code>hexo deploy</code>或<code>hexo d</code>  上传至GitHub（需进行配置）</p>
<p>这时候，博客的基本设置（主题设置留待以后）都已弄好，接下来就是解决将博客内容上传至GitHub上的问题。</p>
<h2 id="Git"><a href="#Git" class="headerlink" title="Git"></a>Git</h2><h3 id="下载安装-1"><a href="#下载安装-1" class="headerlink" title="下载安装"></a>下载安装</h3><p>传送门：<a href="https://git-scm.com/download/" target="_blank" rel="external">git</a>，选择对应版本下载安装。安装过程这边也不叙述了，就点点点。<br><img src="http://ww2.sinaimg.cn/large/0060lm7Tly1fjqg41skzuj30iw07sgmy.jpg" alt="git_down"><br>安装完成后，看下版本<code>git --version</code><br><img src="http://ww1.sinaimg.cn/large/0060lm7Tly1fjqg4fzrisj307b01cmwx.jpg" alt="git_version">    </p>
<h3 id="配置个人信息"><a href="#配置个人信息" class="headerlink" title="配置个人信息"></a>配置个人信息</h3><p>打开Git Bash，配置个人信息，分别输入如下命令，<code>yourname</code>即GitHub注册时的用户名，<code>yourEmail</code>即注册时的邮箱账号，以及生成秘钥：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line">git config --global user.name &quot;yourname&quot;</div><div class="line">git config --global user.email &quot;yourEmail&quot;</div><div class="line"></div><div class="line">ssh-keygen -t rsa -C &quot;yourEmail&quot;</div></pre></td></tr></table></figure></p>
<p>在秘钥生成后，会有对应的存放文件地址，去该地址中，找到<code>id_rsa.pub</code>文件，复制里面的内容，粘贴至GitHub中，点击右上角用户头像下的<code>Settings</code>，之后点击左侧的<code>SSH and GPG keys</code>，找到<code>New SSH key</code>点击，输入<code>title</code>，并将之前复制的内容粘贴到下面的<code>key</code>中，最后点击<code>Add SSH key</code>，完成：<br><img src="http://ww2.sinaimg.cn/large/0060lm7Tly1fmz8kkuoovj30sj0hb3zx.jpg" alt="rsa"></p>
<h3 id="配置Deployment"><a href="#配置Deployment" class="headerlink" title="配置Deployment"></a>配置Deployment</h3><p>去博客总目录下的<code>_config.yml</code>文件中，找到<code>deploy</code>部分，添加如下（yourname就是GitHub的用户名）：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line">deploy:</div><div class="line">  type: git</div><div class="line">  repo: https://github.com/yourname/yourname.github.io.git</div><div class="line">  branch: master</div></pre></td></tr></table></figure></p>
<h3 id="整体流程"><a href="#整体流程" class="headerlink" title="整体流程"></a>整体流程</h3><p>至此，除了博客主题（目前采用默认主题）外，其他基本设置都已弄好。<br>整体的写文上传等操作流程为：<br><code>hexo new newBlog</code><br><code>hexo clean</code><br><code>hexo g</code><br><code>hexo d</code></p>

      
    </div>
    
    
    

    <div>
      
        <div>
    
        <div style="text-align:center;color: #ccc;font-size:22px;">------------- 本 文 结 束 <i class="fa fa-paw"></i> 感 谢 您 的 阅 读 -------------</div>
    
</div>

      
    </div>

    

    
      <div>
        <div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;">
  <div>坚持原创技术分享，您的支持将鼓励我继续创作！</div>
  <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
    <span>Donate</span>
  </button>
  <div id="QR" style="display: none;">

    
      <div id="wechat" style="display: inline-block">
        <img id="wechat_qr" src="/images/wechatpay.png" alt="asdfv1929 WeChat Pay"/>
        <p>WeChat Pay</p>
      </div>
    

    
      <div id="alipay" style="display: inline-block">
        <img id="alipay_qr" src="/images/alipay.png" alt="asdfv1929 Alipay"/>
        <p>Alipay</p>
      </div>
    

    

  </div>
</div>

      </div>
    

    
      <div>
        <ul class="post-copyright">
  <li class="post-copyright-author">
    <strong>Post author:</strong>
    asdfv1929
  </li>
  <li class="post-copyright-link">
    <strong>Post link:</strong>
    <a href="https://asdfv1929.github.io/2017/11/18/hexo-next-blog/" title="利用GitHub+Node.js+Hexo搭建个人博客">https://asdfv1929.github.io/2017/11/18/hexo-next-blog/</a>
  </li>
  <li class="post-copyright-license">
    <strong>Copyright Notice: </strong>
    All articles in this blog are licensed under <a href="https://creativecommons.org/licenses/by-nc-sa/3.0/" rel="external nofollow" target="_blank">CC BY-NC-SA 3.0</a> unless stating additionally.
  </li>
</ul>

      </div>
    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/Hexo/" rel="tag"><i class="fa fa-tag"></i> Hexo</a>
          
            <a href="/tags/Git/" rel="tag"><i class="fa fa-tag"></i> Git</a>
          
            <a href="/tags/GitHub/" rel="tag"><i class="fa fa-tag"></i> GitHub</a>
          
            <a href="/tags/Node-js/" rel="tag"><i class="fa fa-tag"></i> Node.js</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2017/10/04/midautumn/" rel="next" title="中秋节快乐！">
                <i class="fa fa-chevron-left"></i> 中秋节快乐！
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2017/12/31/alexnet/" rel="prev" title="翻译：ImageNet Classification with Deep Convolutional Neural Networks">
                翻译：ImageNet Classification with Deep Convolutional Neural Networks <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
      <div id="gitalk-container"></div>

    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            Table of Contents
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            Overview
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          
            <img class="site-author-image" itemprop="image"
              src="/images/headpic.jpg"
              alt="asdfv1929" />
          
            <p class="site-author-name" itemprop="name">asdfv1929</p>
            <p class="site-description motion-element" itemprop="description"></p>
        </div>

        <nav class="site-state motion-element">

          
            <div class="site-state-item site-state-posts">
            
              <a href="/archives/">
            
                <span class="site-state-item-count">46</span>
                <span class="site-state-item-name">posts</span>
              </a>
            </div>
          

          
            
            
            <div class="site-state-item site-state-categories">
              <a href="/categories/index.html">
                <span class="site-state-item-count">14</span>
                <span class="site-state-item-name">categories</span>
              </a>
            </div>
          

          
            
            
            <div class="site-state-item site-state-tags">
              <a href="/tags/index.html">
                <span class="site-state-item-count">57</span>
                <span class="site-state-item-name">tags</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/asdfv1929" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>GitHub</a>
              </span>
            
              <span class="links-of-author-item">
                <a href="mailto:asdfv1929@163.com" target="_blank" title="E-Mail">
                  
                    <i class="fa fa-fw fa-envelope"></i>E-Mail</a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://blog.csdn.net/tianlong1929" target="_blank" title="CSDN">
                  
                    <i class="fa fa-fw fa-contao"></i>CSDN</a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://music.163.com/#/user/home?id=82875310" target="_blank" title="CloudMusic">
                  
                    <i class="fa fa-fw fa-music"></i>CloudMusic</a>
              </span>
            
          
        </div>


        
        

        
        
          <div class="links-of-blogroll motion-element links-of-blogroll-inline">
            <div class="links-of-blogroll-title">
              <i class="fa  fa-fw fa-globe"></i>
              Links
            </div>
            <ul class="links-of-blogroll-list">
              
                <li class="links-of-blogroll-item">
                  <a href="https://zhengmengping.github.io/" title="Healer" target="_blank">Healer</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.hawky.me/" title="Hawky" target="_blank">Hawky</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://chentao.space/" title="Jack Chen" target="_blank">Jack Chen</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://morefox.net/" title="MOREFOX" target="_blank">MOREFOX</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://inspurer.github.io/" title="月小水长" target="_blank">月小水长</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.newt.fun/" title="不羁的脸闪着青涩" target="_blank">不羁的脸闪着青涩</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://stellarkey.github.io/" title="思维之海" target="_blank">思维之海</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://liujunzhou.top/" title="刘俊周" target="_blank">刘俊周</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://anlan.club/" title="Anlance" target="_blank">Anlance</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://iseexuhs.github.io/" title="ISEEX" target="_blank">ISEEX</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://fanlinxi.cn/" title="無曦" target="_blank">無曦</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://www.pandashen.com/" title="PandaShen" target="_blank">PandaShen</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://blog.fujishiro.cn/" title="FujishiroOtone" target="_blank">FujishiroOtone</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://pengtuo.tech/" title="PeTu" target="_blank">PeTu</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://yizibi.github.io/" title="一之笔" target="_blank">一之笔</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.wliwu.com/" title="WeiJiang1996" target="_blank">WeiJiang1996</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.luameows.wang/" title="Lumo's blog" target="_blank">Lumo's blog</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.cfzhao.com/" title="ZhaoYuwei's Blog" target="_blank">ZhaoYuwei's Blog</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://error666.github.io/" title="☆＼(￣ー￣)／☆" target="_blank">☆＼(￣ー￣)／☆</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://drew233.github.io/" title="Uncle_drew" target="_blank">Uncle_drew</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://ladies.ren/" title="易山博客" target="_blank">易山博客</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://yuzhouwan.com/" title="宇宙湾" target="_blank">宇宙湾</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://chenfeiyang.top/" title="Feiyang Chen" target="_blank">Feiyang Chen</a>
                </li>
              
            </ul>
          </div>
        

        


      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#GitHub"><span class="nav-number">1.</span> <span class="nav-text">GitHub</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#账号注册"><span class="nav-number">1.1.</span> <span class="nav-text">账号注册</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#创建Repository"><span class="nav-number">1.2.</span> <span class="nav-text">创建Repository</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Settings"><span class="nav-number">1.3.</span> <span class="nav-text">Settings</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#GitHub-Page"><span class="nav-number">1.4.</span> <span class="nav-text">GitHub Page</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Node-Js"><span class="nav-number">2.</span> <span class="nav-text">Node.Js</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#下载安装"><span class="nav-number">2.1.</span> <span class="nav-text">下载安装</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#安装Hexo"><span class="nav-number">2.2.</span> <span class="nav-text">安装Hexo</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#本地运行"><span class="nav-number">2.3.</span> <span class="nav-text">本地运行</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#hexo相关命令"><span class="nav-number">2.4.</span> <span class="nav-text">hexo相关命令</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Git"><span class="nav-number">3.</span> <span class="nav-text">Git</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#下载安装-1"><span class="nav-number">3.1.</span> <span class="nav-text">下载安装</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#配置个人信息"><span class="nav-number">3.2.</span> <span class="nav-text">配置个人信息</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#配置Deployment"><span class="nav-number">3.3.</span> <span class="nav-text">配置Deployment</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#整体流程"><span class="nav-number">3.4.</span> <span class="nav-text">整体流程</span></a></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy;  2017 &mdash; 
  <span itemprop="copyrightYear">2021</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">asdfv1929</span>

  
</div>

<!-- 
  <div class="powered-by">Powered by <a class="theme-link" href="https://hexo.io">Hexo</a></div>

  <span class="post-meta-divider">|</span>

  <div class="theme-info">Theme &mdash; <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">NexT.Gemini</a> v5.1.2</div>

 -->

        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
  
    <span class="site-uv">
      <i class="fa fa-user"></i> 访问人数
      <span class="busuanzi-value" id="busuanzi_value_site_uv"></span>
      
    </span>
  

  
    <span class="site-pv">
      <i class="fa fa-eye"></i> 总访问量
      <span class="busuanzi-value" id="busuanzi_value_site_pv"></span>
      次
    </span>
  
</div>





  <script type="text/javascript">
    (function() {
      var hm = document.createElement("script");
      hm.src = "//tajs.qq.com/stats?sId=64887707";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>




        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
          <span id="scrollpercent"><span>0</span>%</span>
        
      </div>
    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/lazyload@2.0.0-beta.2/lazyload.js"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.2/dist/jquery.fancybox.min.js"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.2"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.2"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.2"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.2"></script>



  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.2"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.2"></script>


  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.2"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.2"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.2"></script>



  


  




	





  





  








  <link rel="stylesheet" href="https://unpkg.com/gitalk/dist/gitalk.css">

  <script src="https://unpkg.com/gitalk/dist/gitalk.min.js"></script>
   <script type="text/javascript">
        var gitalk = new Gitalk({
          clientID: '5fe36b6fb87ecd8e46f4',
          clientSecret: '075b050ff7b5e6277fe683d300504bfa5e49037c',
          repo: 'asdfv1929.github.io',
          owner: 'asdfv1929',
          admin: ['asdfv1929'],
          id: location.pathname,
          distractionFreeMode: 'true'
        })
        gitalk.render('gitalk-container')
       </script>



  

  <script type="text/javascript">
    // Popup Window;
    var isfetched = false;
    var isXml = true;
    // Search DB path;
    var search_path = "search.xml";
    if (search_path.length === 0) {
      search_path = "search.xml";
    } else if (/json$/i.test(search_path)) {
      isXml = false;
    }
    var path = "/" + search_path;
    // monitor main search box;

    var onPopupClose = function (e) {
      $('.popup').hide();
      $('#local-search-input').val('');
      $('.search-result-list').remove();
      $('#no-result').remove();
      $(".local-search-pop-overlay").remove();
      $('body').css('overflow', '');
    }

    function proceedsearch() {
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay"></div>')
        .css('overflow', 'hidden');
      $('.search-popup-overlay').click(onPopupClose);
      $('.popup').toggle();
      var $localSearchInput = $('#local-search-input');
      $localSearchInput.attr("autocapitalize", "none");
      $localSearchInput.attr("autocorrect", "off");
      $localSearchInput.focus();
    }

    // search function;
    var searchFunc = function(path, search_id, content_id) {
      'use strict';

      // start loading animation
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay">' +
          '<div id="search-loading-icon">' +
          '<i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>' +
          '</div>' +
          '</div>')
        .css('overflow', 'hidden');
      $("#search-loading-icon").css('margin', '20% auto 0 auto').css('text-align', 'center');

      $.ajax({
        url: path,
        dataType: isXml ? "xml" : "json",
        async: true,
        success: function(res) {
          // get the contents from search data
          isfetched = true;
          $('.popup').detach().appendTo('.header-inner');
          var datas = isXml ? $("entry", res).map(function() {
            return {
              title: $("title", this).text(),
              content: $("content",this).text(),
              url: $("url" , this).text()
            };
          }).get() : res;
          var input = document.getElementById(search_id);
          var resultContent = document.getElementById(content_id);
          var inputEventFunction = function() {
            var searchText = input.value.trim().toLowerCase();
            var keywords = searchText.split(/[\s\-]+/);
            if (keywords.length > 1) {
              keywords.push(searchText);
            }
            var resultItems = [];
            if (searchText.length > 0) {
              // perform local searching
              datas.forEach(function(data) {
                var isMatch = false;
                var hitCount = 0;
                var searchTextCount = 0;
                var title = data.title.trim();
                var titleInLowerCase = title.toLowerCase();
                var content = data.content.trim().replace(/<[^>]+>/g,"");
                var contentInLowerCase = content.toLowerCase();
                var articleUrl = decodeURIComponent(data.url);
                var indexOfTitle = [];
                var indexOfContent = [];
                // only match articles with not empty titles
                if(title != '') {
                  keywords.forEach(function(keyword) {
                    function getIndexByWord(word, text, caseSensitive) {
                      var wordLen = word.length;
                      if (wordLen === 0) {
                        return [];
                      }
                      var startPosition = 0, position = [], index = [];
                      if (!caseSensitive) {
                        text = text.toLowerCase();
                        word = word.toLowerCase();
                      }
                      while ((position = text.indexOf(word, startPosition)) > -1) {
                        index.push({position: position, word: word});
                        startPosition = position + wordLen;
                      }
                      return index;
                    }

                    indexOfTitle = indexOfTitle.concat(getIndexByWord(keyword, titleInLowerCase, false));
                    indexOfContent = indexOfContent.concat(getIndexByWord(keyword, contentInLowerCase, false));
                  });
                  if (indexOfTitle.length > 0 || indexOfContent.length > 0) {
                    isMatch = true;
                    hitCount = indexOfTitle.length + indexOfContent.length;
                  }
                }

                // show search results

                if (isMatch) {
                  // sort index by position of keyword

                  [indexOfTitle, indexOfContent].forEach(function (index) {
                    index.sort(function (itemLeft, itemRight) {
                      if (itemRight.position !== itemLeft.position) {
                        return itemRight.position - itemLeft.position;
                      } else {
                        return itemLeft.word.length - itemRight.word.length;
                      }
                    });
                  });

                  // merge hits into slices

                  function mergeIntoSlice(text, start, end, index) {
                    var item = index[index.length - 1];
                    var position = item.position;
                    var word = item.word;
                    var hits = [];
                    var searchTextCountInSlice = 0;
                    while (position + word.length <= end && index.length != 0) {
                      if (word === searchText) {
                        searchTextCountInSlice++;
                      }
                      hits.push({position: position, length: word.length});
                      var wordEnd = position + word.length;

                      // move to next position of hit

                      index.pop();
                      while (index.length != 0) {
                        item = index[index.length - 1];
                        position = item.position;
                        word = item.word;
                        if (wordEnd > position) {
                          index.pop();
                        } else {
                          break;
                        }
                      }
                    }
                    searchTextCount += searchTextCountInSlice;
                    return {
                      hits: hits,
                      start: start,
                      end: end,
                      searchTextCount: searchTextCountInSlice
                    };
                  }

                  var slicesOfTitle = [];
                  if (indexOfTitle.length != 0) {
                    slicesOfTitle.push(mergeIntoSlice(title, 0, title.length, indexOfTitle));
                  }

                  var slicesOfContent = [];
                  while (indexOfContent.length != 0) {
                    var item = indexOfContent[indexOfContent.length - 1];
                    var position = item.position;
                    var word = item.word;
                    // cut out 100 characters
                    var start = position - 20;
                    var end = position + 80;
                    if(start < 0){
                      start = 0;
                    }
                    if (end < position + word.length) {
                      end = position + word.length;
                    }
                    if(end > content.length){
                      end = content.length;
                    }
                    slicesOfContent.push(mergeIntoSlice(content, start, end, indexOfContent));
                  }

                  // sort slices in content by search text's count and hits' count

                  slicesOfContent.sort(function (sliceLeft, sliceRight) {
                    if (sliceLeft.searchTextCount !== sliceRight.searchTextCount) {
                      return sliceRight.searchTextCount - sliceLeft.searchTextCount;
                    } else if (sliceLeft.hits.length !== sliceRight.hits.length) {
                      return sliceRight.hits.length - sliceLeft.hits.length;
                    } else {
                      return sliceLeft.start - sliceRight.start;
                    }
                  });

                  // select top N slices in content

                  var upperBound = parseInt('1');
                  if (upperBound >= 0) {
                    slicesOfContent = slicesOfContent.slice(0, upperBound);
                  }

                  // highlight title and content

                  function highlightKeyword(text, slice) {
                    var result = '';
                    var prevEnd = slice.start;
                    slice.hits.forEach(function (hit) {
                      result += text.substring(prevEnd, hit.position);
                      var end = hit.position + hit.length;
                      result += '<b class="search-keyword">' + text.substring(hit.position, end) + '</b>';
                      prevEnd = end;
                    });
                    result += text.substring(prevEnd, slice.end);
                    return result;
                  }

                  var resultItem = '';

                  if (slicesOfTitle.length != 0) {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + highlightKeyword(title, slicesOfTitle[0]) + "</a>";
                  } else {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + title + "</a>";
                  }

                  slicesOfContent.forEach(function (slice) {
                    resultItem += "<a href='" + articleUrl + "'>" +
                      "<p class=\"search-result\">" + highlightKeyword(content, slice) +
                      "...</p>" + "</a>";
                  });

                  resultItem += "</li>";
                  resultItems.push({
                    item: resultItem,
                    searchTextCount: searchTextCount,
                    hitCount: hitCount,
                    id: resultItems.length
                  });
                }
              })
            };
            if (keywords.length === 1 && keywords[0] === "") {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-search fa-5x" /></div>'
            } else if (resultItems.length === 0) {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-frown-o fa-5x" /></div>'
            } else {
              resultItems.sort(function (resultLeft, resultRight) {
                if (resultLeft.searchTextCount !== resultRight.searchTextCount) {
                  return resultRight.searchTextCount - resultLeft.searchTextCount;
                } else if (resultLeft.hitCount !== resultRight.hitCount) {
                  return resultRight.hitCount - resultLeft.hitCount;
                } else {
                  return resultRight.id - resultLeft.id;
                }
              });
              var searchResultList = '<ul class=\"search-result-list\">';
              resultItems.forEach(function (result) {
                searchResultList += result.item;
              })
              searchResultList += "</ul>";
              resultContent.innerHTML = searchResultList;
            }
          }

          if ('auto' === 'auto') {
            input.addEventListener('input', inputEventFunction);
          } else {
            $('.search-icon').click(inputEventFunction);
            input.addEventListener('keypress', function (event) {
              if (event.keyCode === 13) {
                inputEventFunction();
              }
            });
          }

          // remove loading animation
          $(".local-search-pop-overlay").remove();
          $('body').css('overflow', '');

          proceedsearch();
        }
      });
    }

    // handle and trigger popup window;
    $('.popup-trigger').click(function(e) {
      e.stopPropagation();
      if (isfetched === false) {
        searchFunc(path, 'local-search-input', 'local-search-result');
      } else {
        proceedsearch();
      };
    });

    $('.popup-btn-close').click(onPopupClose);
    $('.popup').click(function(e){
      e.stopPropagation();
    });
    $(document).on('keyup', function (event) {
      var shouldDismissSearchPopup = event.which === 27 &&
        $('.search-popup').is(':visible');
      if (shouldDismissSearchPopup) {
        onPopupClose();
      }
    });
  </script>





  

  
  <script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.4.js"></script>
  <script>AV.initialize("l2qrG4ju8kp00y3c2cI8tg1y-gzGzoHsz", "LlxAjmFDL6zNzpRAP0cXqfA6");</script>
  <script>
    function showTime(Counter) {
      var query = new AV.Query(Counter);
      var entries = [];
      var $visitors = $(".leancloud_visitors");

      $visitors.each(function () {
        entries.push( $(this).attr("id").trim() );
      });

      query.containedIn('url', entries);
      query.find()
        .done(function (results) {
          var COUNT_CONTAINER_REF = '.leancloud-visitors-count';

          if (results.length === 0) {
            $visitors.find(COUNT_CONTAINER_REF).text(0);
            return;
          }

          for (var i = 0; i < results.length; i++) {
            var item = results[i];
            var url = item.get('url');
            var time = item.get('time');
            var element = document.getElementById(url);

            $(element).find(COUNT_CONTAINER_REF).text(time);
          }
          for(var i = 0; i < entries.length; i++) {
            var url = entries[i];
            var element = document.getElementById(url);
            var countSpan = $(element).find(COUNT_CONTAINER_REF);
            if( countSpan.text() == '') {
              countSpan.text(0);
            }
          }
        })
        .fail(function (object, error) {
          console.log("Error: " + error.code + " " + error.message);
        });
    }

    function addCount(Counter) {
      var $visitors = $(".leancloud_visitors");
      var url = $visitors.attr('id').trim();
      var title = $visitors.attr('data-flag-title').trim();
      var query = new AV.Query(Counter);

      query.equalTo("url", url);
      query.find({
        success: function(results) {
          if (results.length > 0) {
            var counter = results[0];
            counter.fetchWhenSave(true);
            counter.increment("time");
            counter.save(null, {
              success: function(counter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(counter.get('time'));
              },
              error: function(counter, error) {
                console.log('Failed to save Visitor num, with error message: ' + error.message);
              }
            });
          } else {
            var newcounter = new Counter();
            /* Set ACL */
            var acl = new AV.ACL();
            acl.setPublicReadAccess(true);
            acl.setPublicWriteAccess(true);
            newcounter.setACL(acl);
            /* End Set ACL */
            newcounter.set("title", title);
            newcounter.set("url", url);
            newcounter.set("time", 1);
            newcounter.save(null, {
              success: function(newcounter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(newcounter.get('time'));
              },
              error: function(newcounter, error) {
                console.log('Failed to create');
              }
            });
          }
        },
        error: function(error) {
          console.log('Error:' + error.code + " " + error.message);
        }
      });
    }

    $(function() {
      var Counter = AV.Object.extend("Counter");
      if ($('.leancloud_visitors').length == 1) {
        addCount(Counter);
      } else if ($('.post-title-link').length > 1) {
        showTime(Counter);
      }
    });
  </script>



  
<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';        
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>


  

  
  
    <script type="text/x-mathjax-config">
      MathJax.Hub.Config({
        tex2jax: {
          inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
          processEscapes: true,
          skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
        }
      });
    </script>

    <script type="text/x-mathjax-config">
      MathJax.Hub.Queue(function() {
        var all = MathJax.Hub.getAllJax(), i;
        for (i=0; i < all.length; i += 1) {
          all[i].SourceElement().parentNode.className += ' has-jax';
        }
      });
    </script>
    <script type="text/javascript" src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
  


  

  

</body>
</html>

<!--崩溃欺骗-->
<script type="text/javascript" src="/js/src/titleqipian.js"></script>


<script type="text/javascript" src="https://unpkg.com/minigrid@3.1.1/dist/minigrid.min.js"></script>

<link rel="stylesheet" href="/photos/photos.css">
<script type="text/javascript" src="/photos/photo.js"></script>
